# -*- coding: utf-8 -*-
from scrapy import Request, Spider
from HelloWorld.items import DongchediRankingItem


class IZanMeiSpider(Spider):
    name = 'izanmei'

    def start_requests(self):
        base_url = 'https://www.izanmei.com/artist/all.html'

        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36',
            'Referer': 'https://www.izanmei.com/'
        }

        yield Request(url=base_url, callback=self.parse, headers = headers)

    def parse(self, response):
        print(r'spider body: ', response.body)

        pass

    def close(self, spider):
        print('爬虫结束，关闭浏览器')
